<?php defined('ROOT_DIR') or die('Access denied!');?>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="content-type" content="text/html" />
	<meta name="author" content="暮雨秋晨" />
	<meta charset="UTF-8" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <meta name="description" content="<?php echo $config['desc'];?>" />
    <meta name="keywords" content="<?php echo $config['keywd'];?>" />
	<title><?php echo $title;?></title>
    <link rel="stylesheet" href="/Application/static/css/main.css" />
    <script src="/Application/static/js/common.js"></script>
</head>
<body>
<!-- header start -->
<header>
<p style="text-align: right;">
<span style="font-size: 2em;margin-left: 1em;display: inline-block;color: #ee7700;float: left;"><a href="<?php echo $config['url'];?>" style="text-decoration: none;"><?php echo $config['name'];?></a></span>
<?php if($login_user):?>
<span style="display: inline-block;margin-right: 1em;"><a href="<?php echo $this->urlCreate('user','home');?>"><?php echo $login_user['user'];?></a><b style="margin: 0 0.5em;">.</b><a href="<?php echo $this->urlCreate('user','logout');?>">注销</a></span>
<?php else:?>
<span style="display: inline-block;margin-right: 1em;"><a href="<?php echo $this->urlCreate('user','login');?>">登录</a><b style="margin: 0 0.5em;">.</b><a href="<?php echo $this->urlCreate('user','register');?>">注册</a></span>
<?php endif;?>
</p>
</header>
<!-- header end -->

<!-- body start -->
<div id="main">

<div id="top"><p style="display: inline-block;margin-left: 6px;border-left: 3px solid blue;padding-left: 5px;cursor: pointer;color: green;margin-bottom: 3px;height: 29px;line-height: 29px;">网站公告</p></div>
<ol id="list">
<?php echo viewAnnouncement(4);?>
</ol>

<?php if(!empty($forums)):?>
<?php foreach($forums as $forum):?>
<div id="top">
<p style="display: inline-block;margin-left: 6px;border-left: 3px solid blue;padding-left: 5px;cursor: pointer;color: green;margin-bottom: 3px;height: 29px;line-height: 29px;"><?php echo $forum['name'];?></p>
</div>
<ul id="list">
<?php echo viewSections($forum['id']);?>
</ul>
<?php endforeach;?>
<?php else:?>
<div id="tip">欢迎使用DoBBS系统</div>
<?php endif;?>

<div id="top"><p style="display: inline-block;margin-left: 6px;border-left: 3px solid blue;padding-left: 5px;cursor: pointer;color: green;margin-bottom: 3px;height: 29px;line-height: 29px;">友情链接</p></div>
<div id="box">
<ul>
<?php echo viewLinks(1);?>
</ul>
</div>

</div>
<!-- body end -->

<footer>
&copy;<a href="http://www.doubear.com">Doubear</a> Driven by <a href="http://www.domvc.com">DoMVC</a> framework
</footer>
</body>
</html>